I have two table Employee and Department and i want to show both tables all data in a Gridview.
my Query is:
SqlConnection con = new SqlConnection(ConnectionString);
String query = "select * from Employee, Department";
SqlCommand cmd = new SqlCommand(query,con);
SqlDataReader dr;
con.Open();
dr = cmd.ExecuteReader();
GridView1.DataSource = dr;
GridView1.DataBind();
con.Close();
but it show only first table record in Gridview .
please help...
Can you answer this question?
Answer
0 Answers